﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BawangMemo.BackendModels;

namespace BawangMemo.BawangMemoView.View
{
    /// <summary>
    /// StatRateView.xaml 的交互逻辑
    /// </summary>
    public partial class StatRateView : UserControl
    {
        private int count;

        public StatRateView()
        {
            InitializeComponent();
        }

        public List<WordWrapper> BackendList
        {
            get;
            set;
        }

        public int Rate
        {
            get
            {
                return rateView.Rate;
            }
            set
            {
                rateView.Rate = value;
            }
        }

        public int Count
        {
            get
            {
                return count;
            }
            set
            {
                count = value;
                //textBlock1 = count + "个";
                hyperlink1.Text = count + "个";
            }
        }

        private void hyperlink1_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (BackendList.Count > 0)
            {
                ReviewWindow win = new ReviewWindow();
                ReviewView view = new ReviewView(BackendList, win);
                win.grid1.Children.Add(view);
                win.ShowDialog();
            }
        }
    }
}
